{extend name="common/base" /}

{block name="style"}
<style type="text/css">
    body{
        background:#F5F5F5;
    }
</style>
{/block}
{block name="body"}
<div class="yhq-mains">
    <ul class="yhq-list">
        {foreach $list as $vo }
        <li>
            <div class="llist-left">
                <p class="p1">¥{$vo['par_value']}</p>
                <p class="p2">订单满{$vo['use_condition']}可用</p>
            </div>
            <div class="list-right">
                <p class="rig-p">{$vo.name}</p>
                {switch name="$vo.status"}
                {case value="0"}
                <div class="rig-div">
                    <div class="rig-ps">过期时间:{$vo.expiry_end}</div>
                    <div class="rig-an js-use" data-id="{$vo.user_coupon_id}">使用</div>
                </div>
                {/case}
                {case value="1"}
                <div class="rig-div">
                    <div class="rig-ps">使用时间:{$vo.usetime}</div>
                    <div class="rig-an2">已使用</div>
                </div>
                {/case}
                {case value="10"}
                <div class="rig-div">
                    <div class="rig-ps">过期时间:{$vo.expiry_end}</div>
                    <div class="rig-an2">已过期</div>
                </div>
                {/case}
                {/switch}
            </div>
        </li>
        {/foreach}
    </ul>
    <input type="hidden" class="js-score" value="{$score}">
    {/block}
    {block name="script"}
    <script>
        $('.js-use').on('click', function () {
            var score = $('.js-score').val();
            var id =$(this).attr('data-id');
            var jump_url = "{:url('comfirmOrder',array('score'=>'OD','id'=>'ID'))}";
            jump_url = jump_url.replace('OD', score);
            jump_url = jump_url.replace('ID', id);
            location.href = jump_url;
        });
    </script>
    {/block}